package HashMap;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class HomeWork05 {
	public static void main(String[] args) {
		int[] arr1 = {1, 2, 3};
        int[] arr2 = {3, 4, 5, 2};
        Map<Integer, Integer> map = new HashMap<>();
        
        for (int num : arr1) {
            map.put(num, 1);
        }
        for (int num : arr2) {
            if (map.containsKey(num)) {
                map.put(num, 2);
            } else {
                map.put(num, 1);
            }
        }
        
        ArrayList<Integer> result = new ArrayList<>();
        for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
            if (entry.getValue() == 1) {
                result.add(entry.getKey());
            }
        }
        System.out.println(result);
    }
}
